import pymysql

class db():
    def __init__(self,host,user,password,database):
        self.connect = pymysql.connect(host=host,user=user,password=password,database=database)
        self.curser = self.connect.cursor()

    def select(self,sql):
        self.curser.execute(sql)
        return self.curser.fetchall()

    def close(self):
        self.curser.close()
        self.connect.close()